package com.mspbots.core.wise.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mspbots.core.DefaultBaseService;
import com.mspbots.core.wise.controller.params.TenantUserParams;
import com.mspbots.core.wise.model.TenantUser;
import com.mspbots.core.wise.model.dto.UserResponse;

import java.util.List;

/**
 * @author billb
 */
public interface TenantUserService extends DefaultBaseService<TenantUser> {

    /**
     * get last tenant user
     *
     * @param tenant tenant id
     * @return
     */
    TenantUser lastOne(Long tenant);

    List<TenantUser> getTenantUsers(Long tenantId, String email, String originalMail);

    /**
     * get tenant user page
     *
     * @param page         user page
     * @param queryWrapper TenantUser wrapper
     * @return UserResponse vo
     */
    IPage<UserResponse> getPage(IPage<TenantUser> page, TenantUserParams queryWrapper);

    List<TenantUser> selectByManagerId(Long manager);

    List<TenantUser> getMessageSwitch(List<Long> userList);

    int updateAll(Long id, TenantUser tenantUser);

    TenantUser selectOneByIdentifier(TenantUser t);
}
